package com.go.where.manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.go.where.manager.dao.GroupDao;
import com.go.where.manager.pojo.GroupInfo;

@Repository("groupDao")
public class GroupDaoImpl extends BaseDaoImpl<GroupInfo> implements
		GroupDao {

	@Override
	public String getNameSpace() {
		return "mybatis.xml.GroupMapper";
	}

	@Override
	public List<String> queryByCustomerId(String customerId) {
		return getSqlSession().selectList(
				getNameSpace() + ".queryByCustomerId", customerId);
	}

	@Override
	public List<GroupInfo> queryByParameters(Map<String, Object> map) {
		return getSqlSession().selectList(
				getNameSpace() + ".queryByCustomerId", map);
	}

	@Override
	public GroupInfo queryByGroupId(GroupInfo groupInfo) {
		return getSqlSession().selectOne(getNameSpace() + ".queryByGroupId",
				groupInfo);
	}

	@Override
	public List<GroupInfo> queryByActivityId(GroupInfo groupInfo) {
		return getSqlSession().selectList(
				getNameSpace() + ".queryByActivityId", groupInfo);
	}

	@Override
	public List<String> queryCustomerIds(GroupInfo groupInfo) {
		return getSqlSession().selectList(getNameSpace() + ".queryCustomerIds",
				groupInfo);
	}

	@Override
	public Integer queryGroupTotalPerson(Map<String, Object> map) {
		return getSqlSession().selectOne(
				getNameSpace() + ".queryGroupTotalPerson", map);
	}

}
